Optimal. Leaf size=77 \[ \frac {\sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \left (x^2+1\right )}{\sqrt {b}}\right )}{2 \sqrt {b} (a-b)}-\frac {\log \left (a x^4+2 a x^2+a-b\right )}{4 (a-b)}+\frac {\log (x)}{a-b} \]
________________________________________________________________________________________
Rubi [A] time = 0.07, antiderivative size = 77, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.318, Rules used = {1114, 705, 29, 634, 618, 206, 628} \begin {gather*} -\frac {\log \left (a x^4+2 a x^2+a-b\right )}{4 (a-b)}+\frac {\sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \left (x^2+1\right )}{\sqrt {b}}\right )}{2 \sqrt {b} (a-b)}+\frac {\log (x)}{a-b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 29
Rule 206
Rule 618
Rule 628
Rule 634
Rule 705
Rule 1114
Rubi steps
\begin {align*} \int \frac {1}{x \left (a-b+2 a x^2+a x^4\right )} \, dx &=\frac {1}{2} \operatorname {Subst}\left (\int \frac {1}{x \left (a-b+2 a x+a x^2\right )} \, dx,x,x^2\right )\\ &=\frac {\operatorname {Subst}\left (\int \frac {1}{x} \, dx,x,x^2\right )}{2 (a-b)}+\frac {\operatorname {Subst}\left (\int \frac {-2 a-a x}{a-b+2 a x+a x^2} \, dx,x,x^2\right )}{2 (a-b)}\\ &=\frac {\log (x)}{a-b}-\frac {\operatorname {Subst}\left (\int \frac {2 a+2 a x}{a-b+2 a x+a x^2} \, dx,x,x^2\right )}{4 (a-b)}-\frac {a \operatorname {Subst}\left (\int \frac {1}{a-b+2 a x+a x^2} \, dx,x,x^2\right )}{2 (a-b)}\\ &=\frac {\log (x)}{a-b}-\frac {\log \left (a-b+2 a x^2+a x^4\right )}{4 (a-b)}+\frac {a \operatorname {Subst}\left (\int \frac {1}{4 a b-x^2} \, dx,x,2 a \left (1+x^2\right )\right )}{a-b}\\ &=\frac {\sqrt {a} \tanh ^{-1}\left (\frac {\sqrt {a} \left (1+x^2\right )}{\sqrt {b}}\right )}{2 (a-b) \sqrt {b}}+\frac {\log (x)}{a-b}-\frac {\log \left (a-b+2 a x^2+a x^4\right )}{4 (a-b)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.05, size = 90, normalized size = 1.17 \begin {gather*} \frac {\left (\sqrt {a}+\sqrt {b}\right ) \log \left (\sqrt {a} \left (x^2+1\right )-\sqrt {b}\right )+\left (\sqrt {b}-\sqrt {a}\right ) \log \left (\sqrt {a} \left (x^2+1\right )+\sqrt {b}\right )-4 \sqrt {b} \log (x)}{4 \sqrt {b} (b-a)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {1}{x \left (a-b+2 a x^2+a x^4\right )} \, dx \end {gather*}
Verification is not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.97, size = 151, normalized size = 1.96 \begin {gather*} \left [-\frac {\sqrt {\frac {a}{b}} \log \left (\frac {a x^{4} + 2 \, a x^{2} - 2 \, {\left (b x^{2} + b\right )} \sqrt {\frac {a}{b}} + a + b}{a x^{4} + 2 \, a x^{2} + a - b}\right ) + \log \left (a x^{4} + 2 \, a x^{2} + a - b\right ) - 4 \, \log \relax (x)}{4 \, {\left (a - b\right )}}, -\frac {2 \, \sqrt {-\frac {a}{b}} \arctan \left (\frac {b \sqrt {-\frac {a}{b}}}{a x^{2} + a}\right ) + \log \left (a x^{4} + 2 \, a x^{2} + a - b\right ) - 4 \, \log \relax (x)}{4 \, {\left (a - b\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.33, size = 71, normalized size = 0.92 \begin {gather*} -\frac {a \arctan \left (\frac {a x^{2} + a}{\sqrt {-a b}}\right )}{2 \, \sqrt {-a b} {\left (a - b\right )}} - \frac {\log \left (a x^{4} + 2 \, a x^{2} + a - b\right )}{4 \, {\left (a - b\right )}} + \frac {\log \left (x^{2}\right )}{2 \, {\left (a - b\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.01, size = 71, normalized size = 0.92 \begin {gather*} \frac {a \arctanh \left (\frac {2 a \,x^{2}+2 a}{2 \sqrt {a b}}\right )}{2 \left (a -b \right ) \sqrt {a b}}+\frac {\ln \relax (x )}{a -b}-\frac {\ln \left (a \,x^{4}+2 a \,x^{2}+a -b \right )}{4 \left (a -b \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 3.13, size = 85, normalized size = 1.10 \begin {gather*} -\frac {a \log \left (\frac {a x^{2} + a - \sqrt {a b}}{a x^{2} + a + \sqrt {a b}}\right )}{4 \, \sqrt {a b} {\left (a - b\right )}} - \frac {\log \left (a x^{4} + 2 \, a x^{2} + a - b\right )}{4 \, {\left (a - b\right )}} + \frac {\log \left (x^{2}\right )}{2 \, {\left (a - b\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 4.56, size = 183, normalized size = 2.38 \begin {gather*} \frac {\ln \relax (x)}{a-b}-\frac {\ln \left (16\,a^4+20\,a^4\,x^2+\frac {\left (b-\sqrt {a\,b}\right )\,\left (x^2\,\left (16\,a^5+80\,b\,a^4\right )-16\,a^4\,b+16\,a^5\right )}{4\,\left (a\,b-b^2\right )}\right )\,\left (b-\sqrt {a\,b}\right )}{4\,\left (a\,b-b^2\right )}-\frac {\ln \left (16\,a^4+20\,a^4\,x^2+\frac {\left (b+\sqrt {a\,b}\right )\,\left (x^2\,\left (16\,a^5+80\,b\,a^4\right )-16\,a^4\,b+16\,a^5\right )}{4\,\left (a\,b-b^2\right )}\right )\,\left (b+\sqrt {a\,b}\right )}{4\,\left (a\,b-b^2\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 5.31, size = 184, normalized size = 2.39 \begin {gather*} \left (- \frac {1}{4 \left (a - b\right )} - \frac {\sqrt {a b}}{4 b \left (a - b\right )}\right ) \log {\left (x^{2} + \frac {4 a b \left (- \frac {1}{4 \left (a - b\right )} - \frac {\sqrt {a b}}{4 b \left (a - b\right )}\right ) + a - 4 b^{2} \left (- \frac {1}{4 \left (a - b\right )} - \frac {\sqrt {a b}}{4 b \left (a - b\right )}\right ) + b}{a} \right )} + \left (- \frac {1}{4 \left (a - b\right )} + \frac {\sqrt {a b}}{4 b \left (a - b\right )}\right ) \log {\left (x^{2} + \frac {4 a b \left (- \frac {1}{4 \left (a - b\right )} + \frac {\sqrt {a b}}{4 b \left (a - b\right )}\right ) + a - 4 b^{2} \left (- \frac {1}{4 \left (a - b\right )} + \frac {\sqrt {a b}}{4 b \left (a - b\right )}\right ) + b}{a} \right )} + \frac {\log {\relax (x )}}{a - b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________